package com.itheima.package4_tool;

import java.util.Hashtable;

public class MyHashtableDemo {
    public static void main(String[] args) throws InterruptedException {
        Hashtable<String,String> map = new Hashtable<>();
        Thread t1 = new Thread(() -> {
            for (int i = 0; i < 25; i++) {
                map.put(i + "", i + "");
            }
        });
        Thread t2 = new Thread(() -> {
            for (int i = 25; i < 51; i++) {
                map.put(i + "", i + "");
            }
        });
        t1.start();
        t2.start();
        System.out.println("----------------------------");
        Thread.sleep(1000);

        //0-0 1-1 ..... 50- 50

        for (int i = 0; i < 51; i++) {
            System.out.println(map.get(i + ""));
        }
    }
}
